TARGET=vash
SRC=$(shell find -name '*.cpp'|sort)
HEADERS=$(shell find -name '*.h')
OBJ=$(SRC:.cpp=.o)
CFLAGS:=-g -Wall $(shell pkg-config --cflags sqlite3)$(shell pkg-config --cflags ncurses)
LFLAGS:=$(shell pkg-config --libs sqlite3)$(shell pkg-config --libs ncurses) -pthread

$(TARGET) : $(OBJ)
	g++ $(LFLAGS) $(OBJ) -o $@

%.o : %.cpp %.h
	g++ $(CFLAGS) -c $< -o $@

%.o : %.cpp
	g++ $(CFLAGS) -c $< -o $@

%.eps : %.dot
	dot -Teps $< -O

clean:
	-@rm $(TARGET) $(OBJ) &> /dev/null

edit: clean
	kate $(SRC) $(HEADERS) Makefile &> /dev/null &

uninstall:
	rm -rf $(HOME)/.config/vash